let imgs = ["celling.avif", "fire.avif", "sea.avif"];
let body = document.querySelector("body");
let left = document.querySelector(".left");
let right = document.querySelector(".right");
let slide = document.querySelector(".slide");
let flag = true;
let i = 0;
left.addEventListener("click", () => {
  i = (i + 3 - 1) % 3;
  let url = `url("${imgs[i]}")`;
  slide.style.background = url;
  body.style.background = url;
});

right.addEventListener("click", () => {
  i = (i + 1) % 3;
  let url = `url("${imgs[i]}")`;
  slide.style.background = url;
  body.style.background = url;
});
